<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
      <el-form-item label="项目名称" prop="projectName">
        <el-input
          v-model="queryParams.projectName"
          placeholder="请输入项目名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="建设单位" prop="buildUnit">
        <el-input
          v-model="queryParams.buildUnit"
          placeholder="请输入建设单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="施工单位" prop="construnctionUnit">
        <el-input
          v-model="queryParams.construnctionUnit"
          placeholder="请输入施工单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="审核状态" prop="reportStatus">
        <DictRadio v-model="queryParams.reportStatus" :radioData="reportStatusOption" :showAll="'all'"
                   size="small" @change="handleQuery"></DictRadio>
      </el-form-item>

      <el-form-item label="施工类型" prop="constructionType">
        <el-select v-model="queryParams.constructionType" placeholder="请选择施工类型" clearable>
          <el-option
            v-for="dict in dict.type.business_cons_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
<!--      <el-form-item label="联系电话" prop="telePhone">-->
<!--        <el-input-->
<!--          v-model="queryParams.telePhone"-->
<!--          placeholder="请输入联系电话"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="施工开始时间" prop="construnctionStartTime">-->
<!--        <el-date-picker clearable-->
<!--          v-model="queryParams.construnctionStartTime"-->
<!--          style="width: 215px"-->
<!--          type="date"-->
<!--          value-format="yyyy-MM-dd"-->
<!--          placeholder="请选择施工开始时间">-->
<!--        </el-date-picker>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="施工完成时间" prop="construnctionEndTime">-->
<!--        <el-date-picker clearable-->
<!--          v-model="queryParams.construnctionEndTime"-->
<!--          style="width: 215px"-->
<!--          type="date"-->
<!--          value-format="yyyy-MM-dd"-->
<!--          placeholder="请选择施工完成时间">-->
<!--        </el-date-picker>-->
<!--      </el-form-item>-->
      <el-form-item label="施工起止日期" prop="dateRange">
        <el-date-picker
          v-model="queryParams.dateRange"
          style="width: 215px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="施工开始日期"
          end-placeholder="施工结束日期"
        ></el-date-picker>
      </el-form-item>

<!--      <el-form-item label="预计占道时间" prop="planInTime">-->
<!--        <el-date-picker clearable-->
<!--          v-model="queryParams.planInTime"-->
<!--          style="width: 215px"-->
<!--          type="date"-->
<!--          value-format="yyyy-MM-dd"-->
<!--          placeholder="请选择预计占道时间">-->
<!--        </el-date-picker>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="所属管辖大队" prop="deptId">-->
<!--        <el-input-->
<!--          v-model="queryParams.deptId"-->
<!--          placeholder="请输入所属管辖大队"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->

      <el-form-item label="施工状态" prop="constructionStatus">
        <el-select v-model="queryParams.constructionStatus" placeholder="请选择施工状态" clearable>
          <el-option
            v-for="dict in constructionStatusOption"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="报备单号" prop="reportNum">
        <el-input
          v-model="queryParams.reportNum"
          placeholder="请输入报备单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['check:reportInfo:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['check:reportInfo:edit']"
        >修改</el-button>
      </el-col>
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="danger"-->
<!--          plain-->
<!--          icon="el-icon-delete"-->
<!--          size="mini"-->
<!--          :disabled="multiple"-->
<!--          @click="handleDelete"-->
<!--          v-hasPermi="['check:reportInfo:remove']"-->
<!--        >删除</el-button>-->
<!--      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['check:reportInfo:export']"
        >导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit-outline"
          size="mini"
          :disabled="single"
          @click="handleComplete"
          v-hasPermi="['check:reportInfo:appr']"
        >审阅</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="reportInfoList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键" align="center" prop="reportInfoId" width="100" fixed  v-element-table-tooltip/>
      <el-table-column label="报备单号" align="center" prop="reportNum" width="160"  v-element-table-tooltip fixed>
        <template slot-scope="scope">
          <router-link :to="'/check/reportInfo/gantetu/'+scope.row.reportInfoId" class="link-type">
            <span>{{ scope.row.reportNum }}</span>
          </router-link>
        </template>
      </el-table-column>
      <el-table-column label="项目名称" align="center" prop="projectName" width="290"fixed  v-element-table-tooltip/>
      <el-table-column label="施工状态" align="center" width="110" fixed >
        <template slot-scope="scope">
          <el-tag effect="plain" size="medium" :type="constructionStatusOption[scope.row.constructionStatus].type" >{{constructionStatusOption[scope.row.constructionStatus].label}}</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="建设单位" align="center" prop="buildUnit" width="150"  v-element-table-tooltip/>
      <el-table-column label="施工单位" align="center" prop="construnctionUnit" width="150"  v-element-table-tooltip v-element-table-tooltip/>
      <el-table-column label="备案日期" align="center" prop="filingDate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.filingDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="施工内容" align="center" prop="construnctionContent"  v-element-table-tooltip/>
<!--      <el-table-column label="许可时间" align="center" prop="licenseTime" width="100">-->
<!--        <template slot-scope="scope">-->
<!--          <span>{{ parseTime(scope.row.licenseTime, '{y}-{m}-{d}') }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="批准文号" align="center" prop="approvalNumber" />-->

      <el-table-column label="施工路段">
        <el-table-column label="施工开始路段" align="center" prop="expresswayStartSectionName" width="120"  :show-overflow-tooltip='true'/>
        <el-table-column label="施工结束路段" align="center" prop="expresswayEndSectionName" width="120"  :show-overflow-tooltip='true'/>
        <el-table-column label="施工开始方向" align="center" prop="constructionStartDirection" width="120">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.business_cons_direction_type" :value="scope.row.constructionStartDirection"/>
          </template>
        </el-table-column>
        <el-table-column label="施工结束方向" align="center" prop="constructionEndDirection" width="120">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.business_cons_direction_type" :value="scope.row.constructionEndDirection"/>
          </template>
        </el-table-column>
        <el-table-column label="施工开始桩号km" align="center" prop="constructionStartKm" width="120" :show-overflow-tooltip='true'/>
<!--        <el-table-column label="施工开始桩号m" align="center" prop="constructionStartM" width="120"/>-->
        <el-table-column label="施工结束桩号km" align="center" prop="constructionEndKm" width="120" :show-overflow-tooltip='true'/>
<!--        <el-table-column label="施工结束桩号m" align="center" prop="constructionEndM" width="120"/>-->
      </el-table-column>

      <el-table-column label="施工类型" align="center" prop="constructionType" width="100">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.business_cons_type" :value="scope.row.constructionType"/>
        </template>
      </el-table-column>
      <el-table-column label="现场负责人" align="center" prop="head" width="90"/>
      <el-table-column label="联系电话" align="center" prop="telePhone"  width="110" v-element-table-tooltip/>

      <el-table-column label="施工日期">
        <el-table-column label="起" align="center" prop="construnctionStartTime" width="120">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.construnctionStartTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="止" align="center" prop="construnctionEndTime" width="120">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.construnctionEndTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
      </el-table-column>

      <el-table-column label="施工时段">
        <el-table-column label="起" align="center" prop="construnctionStartTime" width="120">
          <template slot-scope="scope">
            <span>{{ scope.row.startTimePeriod }}</span>
          </template>
        </el-table-column>
        <el-table-column label="止" align="center" prop="construnctionEndTime" width="120">
          <template slot-scope="scope">
            <span>{{ scope.row.endTimePeriod }}</span>
          </template>
        </el-table-column>
      </el-table-column>

      <el-table-column label="预计占道时间" align="center" prop="planInTime" width="120">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.planInTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审核状态" align="center" prop="reportStatus">
        <template slot-scope="scope">
          <span v-if="scope.row.reportStatus == 0" style="color: #FFB009">草稿</span>
          <span v-if="scope.row.reportStatus == 1" style="color: #0089FF">待接收</span>
          <span v-if="scope.row.reportStatus == 2" style="color: #59DD34">通过</span>
          <span v-if="scope.row.reportStatus == 3" style="color: #FF0000">驳回</span>
        </template>
      </el-table-column>
      <el-table-column label="所属管辖大队" align="center" prop="deptName" width="100"/>
      <el-table-column label="审核人" align="center" prop="reviewedByName" />
      <el-table-column label="创建人" align="center" prop="updateByName" />
      <el-table-column label="是否归档" align="center" prop="isArchived" >
        <template slot-scope="scope">
          <span v-if="scope.row.isArchived == 0" style="color: #FFB009">未归档</span>
          <span v-if="scope.row.isArchived == 1" style="color: #59DD34">已归档</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="160">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['check:reportInfo:edit']"
            v-show="(scope.row.reportStatus ==0 || scope.row.reportStatus == 3) && scope.row.createBy == currentUserId"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-if="scope.row.reportStatus ==0"
            v-hasPermi="['check:reportInfo:remove']"
          >删除</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleComplete(scope.row)"
            v-hasPermi="['check:reportInfo:appr']"
            v-show="scope.row.reportStatus ==1 && scope.row.reviewedBy == currentUserId"
          >审阅</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleView(scope.row,scope.index)"
          >详情</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改报备信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="130px">

        <el-row>
          <el-col :span="8">
            <el-form-item label="项目名称" prop="projectName">
              <el-input v-model="form.projectName" placeholder="请输入项目名称" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="建设单位" prop="buildUnit">
              <el-input v-model="form.buildUnit" placeholder="请输入建设单位" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="施工单位" prop="construnctionUnit">
              <el-input v-model="form.construnctionUnit" placeholder="请输入施工单位" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="施工开始路段" prop="expresswayStartSectionId">
              <el-select v-model="form.expresswayStartSectionId" filterable placeholder="请选择施工开始路段" style="width: 100%">
                <el-option
                  v-for="item in expresswaySectionOption"
                  :key="item.expresswaySectionId"
                  :label="item.expresswaySectionName + item.startStation +'至'+ item.endStation"
                  :value="item.expresswaySectionId">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="施工开始方向" prop="constructionStartDirection">
              <el-select v-model="form.constructionStartDirection" placeholder="请选择施工开始方向">
                <el-option
                  v-for="dict in dict.type.business_cons_direction_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="施工开始桩号" prop="constructionStartKm">
              <el-input v-model="form.constructionStartKm" placeholder="开始桩号km">
                  <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px; color: #1e1e1e">km</i>
              </el-input>
            </el-form-item>
          </el-col>

<!--          <el-col :span="6">-->
<!--            <el-form-item label="施工开始桩号" prop="constructionStartM">-->
<!--              <el-input v-model="form.constructionStartM" placeholder="开始桩号m" >-->
<!--                  <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px; color: #1e1e1e">m</i>-->
<!--              </el-input>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="施工结束路段" prop="expresswayEndSectionId" >
              <el-select v-model="form.expresswayEndSectionId" filterable placeholder="请选施工结束路段" style="width: 100%">
                <el-option
                  v-for="item in expresswaySectionOption"
                  :key="item.expresswaySectionId"
                  :label="item.expresswaySectionName + item.startStation +'至'+ item.endStation"
                  :value="item.expresswaySectionId">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="施工结束方向" prop="constructionEndDirection" >
              <el-select v-model="form.constructionEndDirection" placeholder="请选择施工结束方向">
                <el-option
                  v-for="dict in dict.type.business_cons_direction_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="施工结束桩号" prop="constructionEndKm">
              <el-input v-model="form.constructionEndKm" placeholder="结束桩号km" >
                  <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px; color: #1e1e1e">km</i>
              </el-input>
            </el-form-item>
          </el-col>

<!--          <el-col :span="6">-->
<!--            <el-form-item label="施工结束桩号" prop="constructionEndM">-->
<!--              <el-input v-model="form.constructionEndM" placeholder="结束桩号m">-->
<!--                  <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px; color: #1e1e1e">m</i>-->
<!--              </el-input>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="施工类型" prop="constructionType">
              <el-select v-model="form.constructionType" placeholder="请选择施工类型" style="width: 255px">
                <el-option
                  v-for="dict in dict.type.business_cons_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="现场负责人" prop="head">
              <el-input v-model="form.head" placeholder="请输入现场负责人" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系电话" prop="telePhone">
              <el-input v-model="form.telePhone" placeholder="请输入联系电话" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="施工起止日期" prop="dateRange">
              <el-date-picker
                v-model="form.dateRange"
                style="width: 258px"
                value-format="yyyy-MM-dd"
                type="daterange"
                range-separator="-"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              ></el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="施工起止时段" prop="timeRange">
              <el-time-picker
                style="width: 258px"
                is-range
                value-format="HH:mm:ss"
                arrow-control
                v-model="form.timeRange"
                range-separator="至"
                start-placeholder="开始时间"
                end-placeholder="结束时间"
                placeholder="选择时间范围">
              </el-time-picker>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="预计占道时间" prop="planInTime">
              <el-date-picker clearable
                              v-model="form.planInTime"
                              style="width: 255px"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择预计占道时间"
                              :picker-options="pickerOptions">
              </el-date-picker>
            </el-form-item>
          </el-col>
<!--          <el-col :span="8">-->
<!--            <el-form-item label="施工开始时间" prop="construnctionStartTime">-->
<!--              <el-date-picker clearable-->
<!--                              v-model="form.construnctionStartTime"-->
<!--                              style="width: 255px"-->
<!--                              type="date"-->
<!--                              value-format="yyyy-MM-dd"-->
<!--                              placeholder="请选择施工开始时间">-->
<!--              </el-date-picker>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--          <el-col :span="8">-->
<!--            <el-form-item label="施工完成时间" prop="construnctionEndTime">-->
<!--              <el-date-picker clearable-->
<!--                              v-model="form.construnctionEndTime"-->
<!--                              style="width: 255px"-->
<!--                              type="date"-->
<!--                              value-format="yyyy-MM-dd"-->
<!--                              placeholder="请选择施工完成时间">-->
<!--              </el-date-picker>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
        </el-row>

<!--        <el-row>-->
<!--          <el-col :span="8">-->
<!--            <el-form-item label="备案日期" prop="filingDate">-->
<!--              <el-date-picker clearable-->
<!--                              v-model="form.filingDate"-->
<!--                              style="width: 255px"-->
<!--                              type="date"-->
<!--                              value-format="yyyy-MM-dd"-->
<!--                              placeholder="请选择备案日期">-->
<!--              </el-date-picker>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--          <el-col :span="8">-->
<!--            <el-form-item label="许可时间" prop="licenseTime">-->
<!--              <el-date-picker clearable-->
<!--                              v-model="form.licenseTime"-->
<!--                              style="width: 255px"-->
<!--                              type="date"-->
<!--                              value-format="yyyy-MM-dd"-->
<!--                              placeholder="请选择许可时间">-->
<!--              </el-date-picker>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--          <el-col :span="8">-->
<!--            <el-form-item label="批准文号" prop="approvalNumber">-->
<!--              <el-input v-model="form.approvalNumber" placeholder="请输入批准文号" />-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--        </el-row>-->

        <el-row>
          <el-col :span="24">
            <el-form-item label="施工许可文件" prop="licenseFile">
              <file-upload  @input="getFileList" :fileLocationName="'licenseFile'" :value="this.licenseFileData" :fileSize="50"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="施工组织方案" prop="organizationFile">
              <file-upload  @input="getFileList" :fileLocationName="'organizationFile'" :value="this.organizationFileData" :fileSize="50"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="交通组织方案" prop="trafficFile">
              <file-upload  @input="getFileList" :fileLocationName="'trafficFile'" :value="this.trafficFileData" :fileSize="50"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="应急预案" prop="emergencyPlanFile">
              <file-upload  @input="getFileList" :fileLocationName="'emergencyPlanFile'" :value="this.emergencyPlanFileData" :fileSize="50"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="安全培训材料" prop="safetyTrainingFile">
              <file-upload  @input="getFileList" :fileLocationName="'safetyTrainingFile'" :value="this.safetyTrainingFileData" :fileSize="50"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="资质证明材料" prop="qualificationCertificationFile">
              <file-upload  @input="getFileList" :fileLocationName="'qualificationCertificationFile'" :value="this.qualificationCertificationFileData" :fileSize="50"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="其他材料" prop="otherFile">
              <file-upload  @input="getFileList" :fileLocationName="'otherFile'" :value="this.otherFileData" :fileSize="50"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="施工内容" prop="construnctionContent">
              <el-input v-model="form.construnctionContent" type="textarea" placeholder="施工内容"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="其他备注" prop="remark">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入其他备注" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="所属管辖大队" prop="deptId">
              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属大队" @select="this.getDetpUser"/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系人" prop="deptLeader">
              <el-input v-model="form.deptLeader" placeholder="联系人" :disabled="true" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系电话" prop="deptPhone">
              <el-input v-model="form.deptPhone" placeholder="联系电话" :disabled="true"/>
            </el-form-item>
          </el-col>

        </el-row>

<!--        <el-row>-->
<!--          <el-col :span="8">-->
<!--            <el-form-item label="审核人" prop="reviewedBy">-->
<!--              <el-select v-model="form.reviewedBy" placeholder="请选择审核人" style="width: 255px">-->
<!--                <el-option-->
<!--                  v-for="user in userOptions"-->
<!--                  :key="user.userId"-->
<!--                  :label="user.nickName"-->
<!--                  :value="user.userId"-->
<!--                ></el-option>-->
<!--              </el-select>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--        </el-row>-->

        <el-row>
          <!---审批表格-->
          <el-table v-loading="loading" :data="reportApprLogList" v-if="this.reportApprLogList.length >0">
            <el-table-column label="提交时间" align="center" prop="submitTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.submitTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="提交人" align="center" prop="submitUserName" />
            <el-table-column label="审核时间" align="center" prop="apprTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.apprTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="审核人" align="center" prop="apprUserName" />
            <el-table-column label="审核状态" align="center" prop="apprStatus">
              <template slot-scope="scope">
                <span v-if="scope.row.apprStatus == 0" style="color: #FFB009">通过</span>
                <span v-if="scope.row.apprStatus == 1" style="color: #FF0000">驳回</span>
              </template>
            </el-table-column>
            <el-table-column label="审核意见" align="center" prop="apprComent" />
          </el-table>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <!--做个判断 只有新增 和 草稿 状态 才有暂存按钮-->
        <el-button type="primary" @click="saveForm(0)"
                   v-if="this.form.reportStatus == null || this.form.reportStatus == 0">暂 存</el-button>
        <el-button type="danger" @click="submitForm(1)">提 交</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>


    <!--审批任务-->
    <el-dialog title="审阅" :visible.sync="completeOpen" width="60%" append-to-body>
      <el-form ref="taskForm" :model="taskForm">
        <el-form-item>
          <el-radio v-model="taskForm.apprStatus" label="0" >接收</el-radio>
          <el-radio v-model="taskForm.apprStatus" label="1">驳回</el-radio>
        </el-form-item>
        <el-form-item label="处理意见" label-width="80px">
          <el-input v-model="taskForm.apprComent" type="textarea" placeholder="请输入处理意见"/>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="completeOpen = false">取 消</el-button>
          <el-button type="primary" @click="submitTaskForm">确 定</el-button>
        </span>
    </el-dialog>


    <!-- 报备信息详情对话框 -->
    <el-dialog :title="title" :visible.sync="viewOpen" width="1200px" append-to-body>
      <el-form label-width="130px">

        <el-row>
          <el-col :span="8">
            <el-form-item label="项目名称：">{{ form.projectName }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="建设单位：">{{ form.buildUnit }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="施工单位：">{{ form.construnctionUnit }}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="施工开始路段：">{{ form.expresswayStartSectionName }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="施工开始方向：">
              <dict-tag :options="dict.type.business_cons_direction_type" :value="form.constructionStartDirection"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="开始桩号km：">{{ form.constructionStartKm }}</el-form-item>
          </el-col>

<!--          <el-col :span="6">-->
<!--            <el-form-item label="施工开始桩号m：">{{ form.constructionStartM }}</el-form-item>-->
<!--          </el-col>-->
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="施工结束路段：">{{ form.expresswayEndSectionName }}</el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="施工结束方向：">
              <dict-tag :options="dict.type.business_cons_direction_type" :value="form.constructionEndDirection"/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="结束桩号km：">{{ form.constructionEndKm }}</el-form-item>
          </el-col>

<!--          <el-col :span="6">-->
<!--            <el-form-item label="施工结束桩号m：">{{ form.constructionEndM }}</el-form-item>-->
<!--          </el-col>-->
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="施工类型：">
              <dict-tag :options="dict.type.business_cons_type" :value="form.constructionType"/>
            </el-form-item>

          </el-col>
          <el-col :span="8">
            <el-form-item label="现场负责人：">{{ form.head }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系电话：">{{ form.telePhone }}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="施工起止日期：">{{ form.construnctionStartTime + '  -  ' + form.construnctionEndTime}}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="施工起止时段：">{{ form.startTimePeriod + '  -  ' + form.endTimePeriod }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="预计占道时间：">{{ form.planInTime }}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="备案日期：">{{ form.filingDate }}</el-form-item>
          </el-col>
<!--          <el-col :span="8">-->
<!--            <el-form-item label="许可时间：">{{ form.licenseTime }}</el-form-item>-->
<!--          </el-col>-->
<!--          <el-col :span="8">-->
<!--            <el-form-item label="批准文号：">{{ form.approvalNumber }}</el-form-item>-->
<!--          </el-col>-->
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="施工组织方案：" prop="organizationFile">
              <file-preview  @input="getFileList" :fileLocationName="'organizationFile'" :value="this.organizationFileData"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="24">
            <el-form-item label="施工许可文件：" prop="licenseFile">
              <file-preview  @input="getFileList" :fileLocationName="'licenseFile'" :value="this.licenseFileData"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="交通组织方案：" prop="trafficFile">
              <file-preview :value="this.trafficFileData"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="应急预案：" prop="emergencyPlanFile">
              <file-preview :value="this.emergencyPlanFileData"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="安全培训材料：" prop="safetyTrainingFile">
              <file-preview :value="this.safetyTrainingFileData"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="资质证明材料：" prop="qualificationCertificationFile">
              <file-preview :value="this.qualificationCertificationFileData"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="其他材料：" prop="otherFile">
              <file-preview :value="this.otherFileData"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="25">
            <el-form-item label="施工内容：">{{ form.construnctionContent }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="其他备注：">{{ form.remark }}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="所属管辖大队：">{{ form.deptName }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系人：">{{ form.deptLeader }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系电话：">{{ form.deptPhone }}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <!---审批表格-->
          <el-table v-loading="loading" :data="reportApprLogList" v-if="this.reportApprLogList.length >0">
            <el-table-column label="提交时间" align="center" prop="submitTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.submitTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="提交人" align="center" prop="submitUserName" />
            <el-table-column label="审核时间" align="center" prop="apprTime" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.apprTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="审核人" align="center" prop="apprUserName" />
            <el-table-column label="审核状态" align="center" prop="apprStatus" >
              <template slot-scope="scope">
                <span v-if="scope.row.apprStatus == 0" style="color: #FFB009">通过</span>
                <span v-if="scope.row.apprStatus == 1" style="color: #FF0000">驳回</span>
              </template>
            </el-table-column>
            <el-table-column label="审核意见" align="center" prop="apprComent" />
          </el-table>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="viewOpen = false">关 闭</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { listreportInfo, getreportInfo, delreportInfo, addreportInfo, updatereportInfo } from "@/api/check/reportInfo";
import { selectListExpresswaySection } from "@/api/check/expresswaySection";
import { deptUserTreeSelect } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { selectListReportApprLog,addReportApprLog } from "@/api/check/reportApprLog";

export default {
  name: "reportInfo",
  components: { Treeselect },
  dicts: ['business_cons_direction_type', 'business_cons_type'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 报备信息表格数据
      reportInfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      //  是否显示审核弹出层
      completeOpen: false,
      //  是否显示详情弹出层
      viewOpen: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reportNum: null,
        buildUnit: null,
        construnctionUnit: null,
        approvalNumber: null,
        expresswayStartSectionId: null,
        expresswayEndSectionId: null,
        constructionType: null,
        telePhone: null,
        construnctionStartTime: null,
        construnctionEndTime: null,
        planInTime: null,
        reportStatus: null,
        deptId: null,
        isArchived: null,
        reportInfoId: null,
      },
      // 表单参数
      form: {},

      // 审核表单参数
      taskForm: {
        reportInfoId: "",// 报备id
        apprStatus: "0",//审批状态
        apprComent: "", // 意见内容
      },

      //  施工组织方案
      organizationFileData:[],
      //  施工许可文件
      licenseFileData:[],
      //  交通组织方案文件
      trafficFileData:[],
      //  应急预案文件
      emergencyPlanFileData:[],
      //  安全培训材料文件
      safetyTrainingFileData:[],
      // 资质证明材料文件
      qualificationCertificationFileData:[],
      //  其他材料文件
      otherFileData:[],

      //  高速路段option
      expresswaySectionOption:[],
      //  组织部门
      deptOptions: undefined,
      //  部门人员
      userOptions: undefined,
      //  审批记录
      reportApprLogList:[],
      //  审批状态
      reportStatusOption:[{label:'草稿',value:0},{label:'待接收',value:1},{label:'通过',value:2},{label:'驳回',value:3}],

      //  施工状态
      constructionStatusOption:[
        {label: '未进场', value: 0, type:''},
        {label: '非占道施工', value: 1, type:'info'},
        {label: '占道施工', value: 2, type:'success'},
        {label: '撤场', value: 3, type:'danger'},
        {label: '结束', value: 4, type:'warning'}
        ],

      currentUserId: this.$store.state.user.id,
      // 表单校验
      rules: {
        filingDate: [
          { required: true, message: "备案日期不能为空", trigger: "blur" }
        ],
        projectName: [
          { required: true, message: "项目名称不能为空", trigger: "blur" }
        ],
        buildUnit: [
          { required: true, message: "建设单位不能为空", trigger: "blur" }
        ],
        construnctionUnit: [
          { required: true, message: "施工单位不能为空", trigger: "blur" }
        ],
        licenseTime: [
          { required: true, message: "许可时间不能为空", trigger: "blur" }
        ],
        approvalNumber: [
          { required: true, message: "批准文号不能为空", trigger: "blur" }
        ],
        expresswayStartSectionId: [
          { required: true, message: "施工开始路段id不能为空", trigger: "change" }
        ],
        expresswayEndSectionId: [
          { required: true, message: "施工结束路段id不能为空", trigger: "change" }
        ],
        constructionStartDirection: [
          { required: true, message: "施工开始方向(上行 下行 上下行)不能为空", trigger: "change" }
        ],
        constructionEndDirection: [
          { required: true, message: "施工结束方向(上行 下行 上下行)不能为空", trigger: "change" }
        ],
        constructionStartKm: [
          { required: true, message: "施工开始桩号km不能为空", trigger: "blur" }
        ],
        constructionStartM: [
          { required: true, message: "施工开始桩号m不能为空", trigger: "blur" }
        ],
        constructionEndKm: [
          { required: true, message: "施工结束桩号km不能为空", trigger: "blur" }
        ],
        constructionEndM: [
          { required: true, message: "施工结束桩号m不能为空", trigger: "blur" }
        ],
        constructionType: [
          { required: true, message: "施工类型不能为空", trigger: "change" }
        ],
        head: [
          { required: true, message: "现场负责人不能为空", trigger: "blur" }
        ],
        telePhone: [
          { required: true, message: "联系电话不能为空", trigger: "blur" }
        ],
        construnctionStartTime: [
          { required: true, message: "施工开始时间不能为空", trigger: "blur" }
        ],
        construnctionEndTime: [
          { required: true, message: "施工完成时间不能为空", trigger: "blur" }
        ],
        planInTime: [
          { required: false, message: "计划进场时间不能为空", trigger: "blur" }
        ],
        construnctionContent: [
          { required: true, message: "施工内容不能为空", trigger: "blur" }
        ],
        remark:[
          { required: false, message: "其他备注不能为空", trigger: "blur" }
        ],
        deptId: [
          { required: true, message: "所属管辖大队不能为空", trigger: "blur" }
        ],
        dateRange: [
          {
            type: 'array',
            required: true,
            message: '请选择施工起止日期',
            fields: {
              // tpye类型试情况而定,所以如果返回的是date就改成date,如果返回的是string就改成string
              0: { type: 'string', required: true, message: '请选择施工起止日期' },
              1: { type: 'string', required: true, message: '请选择施工起止日期' },
            },
          },
        ],
        timeRange: [
          {
            type: 'array',
            required: true,
            message: '请选择施工起止时段',
            fields: {
              // tpye类型试情况而定,所以如果返回的是date就改成date,如果返回的是string就改成string
              0: { type: 'string', required: true, trigger: "change",message: '请选择施工起止时段' },
              1: { type: 'string', required: true, trigger: "change",message: '请选择施工起止时段' },
            },
          },
        ],
      },
      pickerOptions: {
        disabledDate: (time) => {
          let nowData = new Date()
          nowData = new Date(nowData.setDate(nowData.getDate() - 1))
          return time < nowData
        }
      },
    };
  },
  created() {
    this.queryParams.reportInfoId = this.$route.query && this.$route.query.businessId;
    this.getList();
    this.getDeptTree();
  },
  methods: {
    /** 查询报备信息列表 */
    getList() {
      this.loading = true;
      listreportInfo(this.addDateRange(this.queryParams,this.queryParams.dateRange)).then(response => {
        this.reportInfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        reportInfoId: null,
        reportNum: null,
        filingDate: null,
        buildUnit: null,
        construnctionUnit: null,
        construnctionContent: null,
        licenseTime: null,
        approvalNumber: null,
        expresswayStartSectionId: null,
        expresswayEndSectionId: null,
        constructionStartDirection: null,
        constructionEndDirection: null,
        constructionStartKm: null,
        constructionStartM: null,
        constructionEndKm: null,
        constructionEndM: null,
        constructionType: null,
        head: null,
        telePhone: null,
        construnctionStartTime: null,
        construnctionEndTime: null,
        planInTime: null,
        organizationFileId: null,
        licenseFileId: null,
        remark: null,
        occupancyFeeAmount: null,
        reportStatus: null,
        deptId: null,
        reviewedBy: null,
        isArchived: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
      this.organizationFileData = null;
      this.licenseFileData = null;
      //  交通组织方案文件
      this.trafficFileData = null;
      //  应急预案文件
      this.emergencyPlanFileData = null;
      //  安全培训材料文件
      this.safetyTrainingFileData = null;
      // 资质证明材料文件
      this.qualificationCertificationFileData = null;
      //  其他材料文件
      this.otherFileData = null;
      this.reportApprLogList = [];
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.reportInfoId);
      //从缓存里面获取用户类型
      const  userType = this.$store.state.user.userType;
      //执法端
      if (userType == "00") {
        //控制审批按钮  只有状态等于 1
        this.single = !(selection.length===1 && selection[0].reportStatus === 1 && selection[0].reviewedBy === this.currentUserId);
      }else{
        //控制修改按钮  只有状态等于 0 或者 3
        this.single = !(selection.length===1 && (selection[0].reportStatus === 0 || selection[0].reportStatus === 3) && selection[0].createBy === this.currentUserId);
      }
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.getExpresswaySectionList();
      this.open = true;
      this.title = "添加报备信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      this.getExpresswaySectionList();
      const reportInfoId = row.reportInfoId || this.ids[0]
      //审批日志记录
      this.getReportApprLogList(reportInfoId);
      getreportInfo(reportInfoId).then(response => {
        const {code,data} = response;
        this.form = data;
        this.organizationFileData = data.organizationFile;
        this.licenseFileData = data.licenseFile;
        //  交通组织方案文件
        this.trafficFileData= data.trafficFile;
          //  应急预案文件
        this.emergencyPlanFileData= data.emergencyPlanFile;
          //  安全培训材料文件
        this.safetyTrainingFileData= data.safetyTrainingFile;
          // 资质证明材料文件
        this.qualificationCertificationFileData= data.qualificationCertificationFile;
          //  其他材料文件
        this.otherFileData= data.otherFile;
        //日期区间回显
        this.$set(this.form, 'dateRange', [data.construnctionStartTime, data.construnctionEndTime]);
        this.$set(this.form, 'timeRange', [data.startTimePeriod, data.endTimePeriod]);
        this.open = true;
        this.title = "修改报备信息";
      });
    },

    /** 审批按钮操作 */
    handleComplete(row) {
      this.taskForm.apprComent = "";
      const reportInfoId = row.reportInfoId || this.ids[0];
      this.taskForm.reportInfoId = reportInfoId;
      this.completeOpen = true;
    },

    /** 详情按钮操作 */
    handleView(row) {
      this.reset();
      this.getExpresswaySectionList();
      const reportInfoId = row.reportInfoId || this.ids[0]
      //审批日志记录
      this.getReportApprLogList(reportInfoId);
      getreportInfo(reportInfoId).then(response => {
        const {code,data} = response;
        this.form = data;
        this.organizationFileData = data.organizationFile;
        this.licenseFileData = data.licenseFile;
        //  交通组织方案文件
        this.trafficFileData= data.trafficFile;
        //  应急预案文件
        this.emergencyPlanFileData= data.emergencyPlanFile;
        //  安全培训材料文件
        this.safetyTrainingFileData= data.safetyTrainingFile;
        // 资质证明材料文件
        this.qualificationCertificationFileData= data.qualificationCertificationFile;
        //  其他材料文件
        this.otherFileData= data.otherFile;
        this.viewOpen = true;
        this.title = "查看报备信息";
      });
    },

    /** 保存按钮 */
    saveForm(operationType) {
      //设置状态
      this.form.reportStatus = operationType;
      if(!this.form.projectName){
        this.$modal.msgError("请录入项目名称!");
        return;
      }
      if(!this.form.deptId){
        this.$modal.msgError("请选择所属管线大队!");
        return;
      }
      if(this.form.dateRange && this.form.dateRange.length >0){
        this.form.construnctionStartTime = this.form.dateRange[0];
        this.form.construnctionEndTime = this.form.dateRange[1];
      }
      if(this.form.timeRange && this.form.timeRange.length >0){
        this.form.startTimePeriod = this.form.timeRange[0];
        this.form.endTimePeriod = this.form.timeRange[1];
      }
      if (this.form.reportInfoId != null) {
        updatereportInfo(this.form).then(response => {
          this.$modal.msgSuccess("修改成功");
          this.open = false;
          this.getList();
        });
      } else {
        addreportInfo(this.form).then(response => {
          this.$modal.msgSuccess("新增成功");
          this.open = false;
          this.getList();
        });
      }
    },

    /** 提交按钮 */
    submitForm(operationType) {
      this.$refs["form"].validate(valid => {
        if (valid) {
          //设置状态
          this.form.reportStatus = operationType;
          this.form.construnctionStartTime = this.form.dateRange[0];
          this.form.construnctionEndTime = this.form.dateRange[1];
          this.form.startTimePeriod = this.form.timeRange[0];
          this.form.endTimePeriod = this.form.timeRange[1];
          if (this.form.reportInfoId != null) {
            updatereportInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addreportInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const reportInfoIds = row.reportInfoId || this.ids;
      this.$modal.confirm('是否确认删除报备信息编号为"' + reportInfoIds + '"的数据项？').then(function() {
        return delreportInfo(reportInfoIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('check/reportInfo/export', {
        ...this.queryParams
      }, `reportInfo_${new Date().getTime()}.xlsx`)
    },

    //获取附件列表
    getFileList(fileLocationName,fileIds,deleteFileId){
      this.form[fileLocationName] = fileIds;

      // if (deleteFileId != undefined) {
      //   this.deleteFileData.push(deleteFileId);
      //   this.form.deleteFileIds = this.deleteFileData.join(",");
      // }
    },
    /** 查询高速路段信息列表 */
    getExpresswaySectionList() {
      this.loading = true;
      selectListExpresswaySection({}).then(response => {
        this.expresswaySectionOption = response.data;
        this.loading = false;
      });
    },

    /** 查询部门下拉树结构 */
    getDeptTree() {
      deptUserTreeSelect().then(response => {
        this.deptOptions = response.data;
      });
    },

    /** 查询部门人员 */
    async getDetpUser (val) {
      //this.reviewedBy = '';
      this.form.deptLeader = val.leader;
      this.form.deptPhone = val.phone;
      this.userOptions = val.deptUsers;
    },

    /** 用户审批任务 */
    submitTaskForm() {
      if (this.taskForm.apprStatus == 1 && !this.taskForm.apprComent) {
        this.$modal.msgError("请输入审批意见!");
        return;
      }
      this.$refs["taskForm"].validate(valid => {
        if (valid) {
          addReportApprLog(this.taskForm).then(response => {
            this.$modal.msgSuccess("审批成功");
            this.completeOpen = false;
            this.getList();
          });
        }
      });
    },

    /** 报备审批记录 */
    getReportApprLogList(reportInfoId) {
      this.loading = true;
      selectListReportApprLog({reportInfoId:reportInfoId}).then(response => {
        this.reportApprLogList = response.data;
      });
    },
  },

};
</script>
